-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implement block order signaling #25
Conversation
src/handlers/car.js
Outdated
if (!accept) return { version: 1, order: 'dfs', dups: true } | ||
|
||
const types = accept.split(',').map(s => s.trim()) | ||
const carType = types.find(t => t.startsWith('application/vnd.ipld.car')) | ||
if (!carType) return { version: 1, order: 'dfs', dups: true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe have a const for the default params, and flip default order to unk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. good testing. I would maybe switch the last one to simply assert that the expected set of blocks arrives rather than "definitely not dfs", as you comment, dfs is a fine order for unk.
Accept: 'application/vnd.ipld.car; order=unk' | ||
} | ||
}) | ||
const res = await handleCar(req, env, ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: could verify the fancy content-type header is as expected here on the response
🤖 I have created a release *beep* *boop* --- ## [3.1.0](v3.0.0...v3.1.0) (2023-05-19) ### Features * implement block order signaling ([#25](#25)) ([1862165](1862165)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR updates dagula and implements block order signaling via HTTP Accept header as specified in ipfs/specs#412.
It also renames the query param
car-scope
todag-scope
and changes the scope valuefile
toentity
as these were updated in ipfs/specs#402.